From: Florian Müllner Date: Thu, 28 May 2020 22:27:34 +0000 (+0200) Subject: screenshot: Properly clean up if PickColor() is cancelled X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~344 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=55c287280b4d77bc94dce32b8c9e20d318d8c14d;p=gnome-shell.git screenshot: Properly clean up if PickColor() is cancelled We currently only remove the screenshot operation from the shooter map if the color pick operation completed successfully, but not if it was cancelled. As a result, we now reject any further requests from the same sender because we assume that there is an ongoing operation. Fix this by moving the cleanup to a finally clause that runs for both code paths. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1288 --- diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index 5b7e09387..de5d3c063 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -276,12 +276,13 @@ var ScreenshotService = class { blue / 255.0, ]), }]); - this._removeShooterForSender(invocation.get_sender()); invocation.return_value(retval); } catch (e) { invocation.return_error_literal( Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED, 'Operation was cancelled'); + } finally { + this._removeShooterForSender(invocation.get_sender()); } } };